<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>七宫格布局--grid--二维</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
        }
        .container {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr 1fr;
            grid-template-rows: 100px 100px 100px 100px;
            grid-gap: 10px;
            grid-template-areas: 'left mainl mainr right';
        }
        .item {
            background-color: pink;
            text-align: center;
            line-height: 100px;
        }
        .item1,
        .item4 {
            grid-column-start: 1;
            grid-column-end: 2;
        }
        .item2,
        .item5 {
            grid-column-start: 4;
            grid-column-end: 5;
        }
        .item3 {
            grid-column-start: mainl-start;
            grid-column-end: mainr-end;
            /* grid-row-start: 2;
            grid-row-end: 6; */
            /* grid-column-start: span 2; */
            /* grid-area: main; */
        }
        .item6 {
            grid-column-start: 2;
            grid-column-end: 3;
        }
        .item7 {
            grid-column-start: 3;
            grid-column-end: 4;
        }
        
    </style>
</head>
<body>
    <div class="container">
        <div class="item item1">1</div>
        <div class="item item2">2</div>
        <div class="item item3">3</div>
        <div class="item item4">4</div>
        <div class="item item5">5</div>
        <div class="item item6">6</div>
        <div class="item item7">7</div>
    </div>
</body>
</html>